-- 樱桃炸弹类
local Plant = require("app.mode.Plant")
local AniHelper = require("app.utils.AnimateHelper")

local Cherry = {}
setmetatable(Cherry, Plant)
Cherry.__index = Cherry

function Cherry:runAnimate()
    if self._sprite and self._animate then
        local function explode(node, data)
            self._scene:cherryExplode(self)
            self._scene:removePlant(self)
            self:removeSelf()
        end
        local animation = self._animate:getAnimation()
        animation:setDelayPerUnit(0.1)
        animation:setLoops(1)
        self._animate = cc.Animate:create(animation)
        self._sprite:runAction(cc.Sequence:create(self._animate, cc.CallFunc:create(explode), nil))
    end
end

function Cherry:beAttack(attack)
end

return Cherry
